package com.yanmaohu.yulia.bean;

/**
 * @author Bright Lee
 */
public final class UnionNonJoinQueryExpression implements NonJoinQueryExpression {

    private int beginIndex;
    private int endIndex;
    private QueryExpressionBody queryExpressionBody;
    private boolean all;
    private boolean distinct;
    private CorrespondingSpec correspondingSpec;
    private QueryTerm queryTerm;

    public UnionNonJoinQueryExpression(QueryExpressionBody queryExpressionBody,
                                       boolean all,
                                       boolean distinct,
                                       CorrespondingSpec correspondingSpec,
                                       QueryTerm queryTerm) {
        this.beginIndex = queryExpressionBody.getBeginIndex();
        this.endIndex = queryTerm.getEndIndex();
        this.queryExpressionBody = queryExpressionBody;
        this.all = all;
        this.distinct = distinct;
        this.correspondingSpec = correspondingSpec;
        this.queryTerm = queryTerm;
    }

    @Override
    public int getBeginIndex() {
        return beginIndex;
    }

    @Override
    public int getEndIndex() {
        return endIndex;
    }

    public QueryExpressionBody getQueryExpressionBody() {
        return queryExpressionBody;
    }

    public boolean isAll() {
        return all;
    }

    public boolean isDistinct() {
        return distinct;
    }

    public CorrespondingSpec getCorrespondingSpec() {
        return correspondingSpec;
    }

    public QueryTerm getQueryTerm() {
        return queryTerm;
    }

}
